<?php
/**
 * 采购单验证器
 */

namespace app\common\validate;

class SendValidate extends CommonBaseValidate {
	protected $rule = [
		'school_id|学校' => 'require',
		'user_id|供应商' => 'require',
		'code|采购单号' => 'require',
		'send_time|配送时间' => 'require',
		'money|收货金额' => 'require',
		'status|单据状态' => 'require',
		'is_true|是否确认' => 'require',

	];

	protected $message = [
		'school_id.required' => '学校不能为空',
		'user_id.required' => '供应商不能为空',
		'code.required' => '采购单号不能为空',
		'send_time.required' => '配送时间不能为空',
		'money.required' => '收货金额不能为空',
		'status.required' => '单据状态不能为空',
		'is_true.required' => '是否确认不能为空',

	];

	protected $scene = [
		'admin_add' => ['school_id', 'user_id', 'send_time'],
		'admin_edit' => ['id', 'school_id', 'user_id', 'send_time'],
		'admin_del' => ['id'],
		'admin_disable' => ['id'],
		'admin_enable' => ['id'],
		'api_add' => ['school_id', 'user_id', 'code', 'send_time', 'money'],
		'api_info' => ['id'],
		'api_edit' => ['id', 'school_id', 'user_id', 'code', 'send_time', 'money'],
		'api_del' => ['id'],
		'api_disable' => ['id'],
		'api_enable' => ['id'],
	];
}
